import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from "unplugin-vue-components/vite"
import {ElementPlusResolver} from "unplugin-vue-components/resolvers";
import AutoImport from 'unplugin-auto-import/vite'
// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue(),
        AutoImport({
            dts: 'typings/auto-imports.d.ts',
            eslintrc: {
                enabled: true
            },
            imports: [
                'vue',
                'vue-router',
                'pinia'
            ],
            resolvers: [ElementPlusResolver()],
        }),
        Components({
            dirs: ["src/components"], // 要导入组件的目录的路径
            deep: true, // 搜索子目录
            dts: "src/components/components.d.ts", // 生成 `components.d.ts` 全局声明
            resolvers: [
                ElementPlusResolver({
                    importStyle: "sass"
                })
            ]
        })
    ]
})
